import Crypt from "../../../utils/Crypt";
import SearchModel from "../../../models/Search";

const searchModel = new SearchModel()

Page({
  data: {
    list: [],
    keyword: ''
  },
  onLoad: function (options) {

  },

  onSearch(e) {
    const keyword = e.detail.value
    this.setData({
      keyword
    })
    searchModel.submit({
      is_wx: '是',
      user_id: 0,
      keyword
    }).then(response => {
      let { data } = response
      data = Crypt.parse(data)
      this.setData({
        list: data
      })
    })
  }
});
